G_BEGIN_DECLS
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_22_FOR(gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context())
cairo_t * gdk_cairo_create (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
* Note that calling cairo_reset_clip() on the resulting #cairo_t will
* produce undefined results, so avoid it at all costs.
*
+ * Typically, this function is used to draw on a #GdkWindow out of the paint
+ * cycle of the toolkit; this should be avoided, as it breaks various assumptions
+ * and optimizations.
+ *
+ * If you are drawing on a native #GdkWindow in response to a %GDK_EXPOSE event
+ * you should use gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()
+ * instead. GTK will automatically do this for you when drawing a widget.
+ *
* Returns: A newly created Cairo context. Free with
* cairo_destroy() when you are done drawing.
*
* Since: 2.8
+ *
+ * Deprecated: 3.22: Use gdk_window_begin_draw_frame() and
+ * gdk_drawing_context_get_cairo_context() instead
**/
cairo_t *
gdk_cairo_create (GdkWindow *window)
w = gtk_paper_size_get_width (paper_size, GTK_UNIT_INCH);
h = gtk_paper_size_get_height (paper_size, GTK_UNIT_INCH);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
cr = gdk_cairo_create (gtk_widget_get_window (pop->area));
+G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_get_allocation (pop->area, &allocation);
dpi_x = allocation.width/w;
gtk_widget_realize (da);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
cr = gdk_cairo_create (gtk_widget_get_window (da));
+G_GNUC_END_IGNORE_DEPRECATIONS
+
/* TODO: What dpi to use here? This will be used for pagination.. */
gtk_print_context_set_cairo_context (context, cr, 72, 72);
cairo_destroy (cr);
if (surface != NULL)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
+G_GNUC_END_IGNORE_DEPRECATIONS
if (cursor_present && (cursor_present != state ||
x != cursor_x || y != cursor_y))